/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package UISUTModel.impl;

import UISUTModel.UIControl;
import UISUTModel.UIDataVariable;
import UISUTModel.UISUTModelPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>UI Control</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link UISUTModel.impl.UIControlImpl#getItsInputDaa <em>Its Input Daa</em>}</li>
 *   <li>{@link UISUTModel.impl.UIControlImpl#getItsOutputData <em>Its Output Data</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class UIControlImpl extends UISUTElementImpl implements UIControl {
	/**
	 * The cached value of the '{@link #getItsInputDaa() <em>Its Input Daa</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getItsInputDaa()
	 * @generated
	 * @ordered
	 */
	protected UIDataVariable itsInputDaa;

	/**
	 * The cached value of the '{@link #getItsOutputData() <em>Its Output Data</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getItsOutputData()
	 * @generated
	 * @ordered
	 */
	protected UIDataVariable itsOutputData;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected UIControlImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return UISUTModelPackage.Literals.UI_CONTROL;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public UIDataVariable getItsInputDaa() {
		if (itsInputDaa != null && itsInputDaa.eIsProxy()) {
			InternalEObject oldItsInputDaa = (InternalEObject)itsInputDaa;
			itsInputDaa = (UIDataVariable)eResolveProxy(oldItsInputDaa);
			if (itsInputDaa != oldItsInputDaa) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, UISUTModelPackage.UI_CONTROL__ITS_INPUT_DAA, oldItsInputDaa, itsInputDaa));
			}
		}
		return itsInputDaa;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public UIDataVariable basicGetItsInputDaa() {
		return itsInputDaa;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setItsInputDaa(UIDataVariable newItsInputDaa) {
		UIDataVariable oldItsInputDaa = itsInputDaa;
		itsInputDaa = newItsInputDaa;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, UISUTModelPackage.UI_CONTROL__ITS_INPUT_DAA, oldItsInputDaa, itsInputDaa));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public UIDataVariable getItsOutputData() {
		if (itsOutputData != null && itsOutputData.eIsProxy()) {
			InternalEObject oldItsOutputData = (InternalEObject)itsOutputData;
			itsOutputData = (UIDataVariable)eResolveProxy(oldItsOutputData);
			if (itsOutputData != oldItsOutputData) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, UISUTModelPackage.UI_CONTROL__ITS_OUTPUT_DATA, oldItsOutputData, itsOutputData));
			}
		}
		return itsOutputData;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public UIDataVariable basicGetItsOutputData() {
		return itsOutputData;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setItsOutputData(UIDataVariable newItsOutputData) {
		UIDataVariable oldItsOutputData = itsOutputData;
		itsOutputData = newItsOutputData;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, UISUTModelPackage.UI_CONTROL__ITS_OUTPUT_DATA, oldItsOutputData, itsOutputData));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case UISUTModelPackage.UI_CONTROL__ITS_INPUT_DAA:
				if (resolve) return getItsInputDaa();
				return basicGetItsInputDaa();
			case UISUTModelPackage.UI_CONTROL__ITS_OUTPUT_DATA:
				if (resolve) return getItsOutputData();
				return basicGetItsOutputData();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case UISUTModelPackage.UI_CONTROL__ITS_INPUT_DAA:
				setItsInputDaa((UIDataVariable)newValue);
				return;
			case UISUTModelPackage.UI_CONTROL__ITS_OUTPUT_DATA:
				setItsOutputData((UIDataVariable)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case UISUTModelPackage.UI_CONTROL__ITS_INPUT_DAA:
				setItsInputDaa((UIDataVariable)null);
				return;
			case UISUTModelPackage.UI_CONTROL__ITS_OUTPUT_DATA:
				setItsOutputData((UIDataVariable)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case UISUTModelPackage.UI_CONTROL__ITS_INPUT_DAA:
				return itsInputDaa != null;
			case UISUTModelPackage.UI_CONTROL__ITS_OUTPUT_DATA:
				return itsOutputData != null;
		}
		return super.eIsSet(featureID);
	}

} //UIControlImpl
